/**
 * user.js
 * @description user路由
 */

let express = require("express");
let router = express.Router();
let fs = require("fs");

// 访问/user根目录
router.get("/", (req, res) => res.send("user")); // 访问user根路由

// 访问/user/getUserList
router.get("/getUserList", (req, res) => {
  fs.readFile("user.json", "utf8", (err, data) => {
    if (err) throw err;
    res.send(data);
  });
});

module.exports = router;
